<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

class template_type_dropdown_model extends Model
{
	var $name = '';
	var $value = '';
	var $items = array();
	var $onchange;
	
	function template_type_dropdown_model()
	{
		parent::Model();
		
		$this->db->order_by(TEMPLATE_TYPES_NAME);		
		$q = $this->db->get(TEMPLATE_TYPES);
		if ($q->num_rows())
			$this->items = $q->result();
	}
	
	function addOption($o)
	{
		array_unshift($this->items, (object) $o);
	}
}

?>